<template>
  <div>
  <home-header  />
  <HomeSlider :homesliderjson="homesliderjson" />
  <HomeIcons :homeicons="homeicons" />
  <Recommand :recommand="recommand" />
  <Weekday :weekday="weekday" />
  </div>
</template>

<script>
import HomeHeader from "./home/HomeHeader.vue";
import HomeSlider from "./home/Slider.vue";
import HomeIcons from './home/HomeIcons.vue';
import Recommand from './home/Recommand.vue';
import Weekday from './home/Weekday.vue';
import { homejson } from '@/api/homejson'



export default {
  name: "Home",
  data (){
    return{
      homesliderjson: '',
      homeicons:'',
      recommand:'',
      weekday:'',
    }
  },
  components: { 
    HomeHeader,
    HomeSlider,
    HomeIcons,
    Recommand,
    Weekday
     },
     methods:{
       getHomeInfo(){
         homejson().then(res=>{
           console.log(res)
           this.homesliderjson = res.data.total.swiperlist
           this.homeicons = res.data.total.iconList
           this.recommand = res.data.total.itemList
           this.weekday = res.data.total.itemListWeek
           
         })
       }
     },
     mounted(){
       this.getHomeInfo()
     }
};
</script>

<style lang="scss">
  body{margin: 0;}
</style>